﻿using System;
using System.Configuration;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KPIS.DBM;
using KPIS.GERP.GHRMS.MODEL;
using KPIS.GERP.GHRMS.IDAL;

namespace KPIS.GERP.GHRMS.DAL
{
    public sealed class PositionSalary
    {
        // IDBManager dbManager = new DBManager(SystemInfo._DataProvider, SystemInfo._ConnectionString);

        //public PositionSalaryDAL()
        //{
        //}
        //public void Insert(AbsenceTypeInfo Info)
        //{
        //    string strSQL;

        //    try
        //    {
        //        dbManager.Open();
        //        dbManager.BeginTransaction();
        //        dbManager.CreateParameters(8);

        //        dbManager.AddParameters(0, "@AbsenceTypeGroupSeq", Info.GroupSeq);
        //        dbManager.AddParameters(1, "@AbsenceTypeName", Info.Name);
        //        dbManager.AddParameters(2, "@DayCountAdvance", Info.DayAdvance);
        //        dbManager.AddParameters(3, "@IncludeNWD", Info.IncludeNWD == true ? "1" : "0");
        //        dbManager.AddParameters(4, "@Remarks", Info.Remarks);
        //        dbManager.AddParameters(5, "@RecordStatus", SystemInfo._ActiveRecordStatus);
        //        dbManager.AddParameters(6, "@CreatedBy", Info.CreatedBy);
        //        dbManager.AddParameters(7, "@CreatedWhen", DateTime.Today);

        //        strSQL = "INSERT INTO HRM_PS_ABSENCE_TYPES(ABSENCE_TYPE_GROUP_SEQ, ABSENCE_TYPE_NAME"
        //                + ", DAY_COUNT_ADVANCE, INCLUDE_NWD, REMARKS, RECORD_STATUS, CREATED_BY, CREATED_WHEN)"
        //            + " VALUES(@AbsenceTypeGroupSeq, @AbsenceTypeName, @DayCountAdvance"
        //                + ", @IncludeNWD, @Remarks, @RecordStatus, @CreatedBy, @CreatedWhen)";

        //        dbManager.ExecuteNonQuery(CommandType.Text, strSQL);
        //        dbManager.CommitTransaction();
        //    }
        //    catch
        //    {
        //        dbManager.RollBackTransaction();
        //        throw;
        //    }
        //    finally
        //    {
        //        dbManager.CloseReader();
        //        dbManager.Dispose();
        //    }
        //}

        //public void Update(AbsenceTypeInfo Info)
        //{
        //    string strSQL;

        //    try
        //    {
        //        dbManager.Open();
        //        dbManager.BeginTransaction();
        //        dbManager.CreateParameters(8);

        //        dbManager.AddParameters(0, "@AbsenceTypeSeq", Info.Sequence);
        //        dbManager.AddParameters(1, "@AbsenceTypeGroupSeq", Info.GroupSeq);
        //        dbManager.AddParameters(2, "@AbsenceTypeName", Info.Name);
        //        dbManager.AddParameters(3, "@DayCountAdvance", Info.DayAdvance);
        //        dbManager.AddParameters(4, "@IncludeNWD", Info.IncludeNWD == true ? "1" : "0");
        //        dbManager.AddParameters(5, "@Remarks", Info.Remarks);
        //        dbManager.AddParameters(6, "@UpdatedBy", Info.UpdatedBy);
        //        dbManager.AddParameters(7, "@UpdatedWhen", DateTime.Today);

        //        strSQL = "UPDATE HRM_PS_ABSENCE_TYPES"
        //                   + " SET ABSENCE_TYPE_GROUP_SEQ = @AbsenceTypeGroupSeq"
        //                        + ", ABSENCE_TYPE_NAME = @AbsenceTypeName"
        //                        + ", DAY_COUNT_ADVANCE = @DayCountAdvance"
        //                        + ", INCLUDE_NWD = @IncludeNWD"
        //                        + ", REMARKS = @Remarks"
        //                        + ", UPDATED_BY = @UpdatedBy"
        //                        + ", UPDATED_WHEN = @UpdatedWhen"
        //                   + " WHERE ABSENCE_TYPE_SEQ = @AbsenceTypeSeq";

        //        dbManager.ExecuteNonQuery(CommandType.Text, strSQL);
        //        dbManager.CommitTransaction();
        //    }
        //    catch
        //    {
        //        dbManager.RollBackTransaction();
        //        throw;
        //    }
        //    finally
        //    {
        //        dbManager.CloseReader();
        //        dbManager.Dispose();
        //    }
        //}

        //public void Delete(int Sequence, int UpdatedBy)
        //{
        //    string strSQL;

        //    try
        //    {
        //        dbManager.Open();
        //        dbManager.BeginTransaction();
        //        dbManager.CreateParameters(4);

        //        dbManager.AddParameters(0, "@Sequence", Sequence);
        //        dbManager.AddParameters(1, "@RecordStatus", SystemInfo._DeleteRecordStatus);
        //        dbManager.AddParameters(2, "@UpdatedBy", UpdatedBy);
        //        dbManager.AddParameters(3, "@UpdateWhen", DateTime.Today);

        //        strSQL = "UPDATE HRM_PS_ABSENCE_TYPES"
        //            + " SET RECORD_STATUS = @RecordStatus"
        //                + ", UPDATED_BY = @UpdatedBy"
        //                + ", UPDATED_WHEN = @UpdateWhen"
        //            + " WHERE ABSENCE_TYPE_SEQ = @Sequence";

        //        dbManager.ExecuteNonQuery(CommandType.Text, strSQL);
        //        dbManager.CommitTransaction();
        //    }
        //    catch
        //    {
        //        dbManager.RollBackTransaction();
        //        throw;
        //    }
        //    finally
        //    {
        //        dbManager.CloseReader();
        //        dbManager.Dispose();
        //    }
        //}
    }
}
